<template>
	<div class = "ref">
		<h3>3 ref 函数</h3>
		<p>message 的值 {{ message }}</p>
		<button v-on:click="changeMsg()">change message</button>
		<button v-on:click="getMsg()">get message</button>
	</div>
</template>

<script setup>
	import {ref} from 'vue'
	let message = ref('会当凌绝顶一览众山小')
	function changeMsg() {
		message.value = '锲而不舍金石可镂'
	}
	function getMsg() {
		alert(message.value)
	}
</script>


<style scoped>
	.ref {
		font-size: 16px;
		font-weight: bold;
		width: 200px;
		height: 200px;
		border: 1px solid lightgoldenrodyellow;

	}
</style>